package com.zzty.zzlp.dao;

import com.zzty.zzlp.entity.ClassGroup;
import com.zzty.zzlp.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ClassGroupMapper {
    @Delete("delete from classgroup where class_id=#{class_id}")
    Integer delete(Integer clazzId);


    @Select("select * from user where clazzId=#{clazzId} and type=1")
    List<User> selectall(@Param("clazzId") String clazzId);

    @Select("select count(*) from user  where clazzId=#{clazzId} and type=1")
    Integer count(@Param("clazzId") Integer clazzId);


    @Insert("insert into classgroup (class_id,stu_ids) values(#{class_id},#{stu_ids})")
    Integer insertGroup(ClassGroup classGroup);

}
